# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Ben Allen <bensallen@me.com>
pkgname=cpupower
pkgver=5.4.35
pkgrel=0
pkgdesc="Linux kernel tool to examine and tune power saving related features of your processor"
url="https://www.kernel.org/"
arch="all"
license="GPL-2.0-only"
depends_dev="pciutils-dev readline-dev"
makedepends="$depends_dev bash linux-headers gettext-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-openrc $pkgname-bash-completion"
replaces="linux-tools-cpupower"
source="https://kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar.xz
	nls.patch
	cpupower.initd
	cpupower.confd
	"
options="!check" # no tests
builddir="$srcdir"/linux-$pkgver/tools/power/cpupower

build() {
	make NLS=false VERSION=$pkgver-$pkgrel
}

package() {
	make NLS=false VERSION=$pkgver-$pkgrel DESTDIR="$pkgdir" libdir=/usr/lib mandir=/usr/share/man install

	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="66daf0192339450b0838cd1aef013ea8675f8687e2271d8d9b79c842e8cb081541788eb16fb0b6e5cd0b15617be67813c53a4db2d2e63219f3c64e692c325c5d  linux-5.4.35.tar.xz
3f95439c334a5b1dd173c4ed2e58721d4687177e3b4070b375deaca38062bd88af352838acbff8b2bc8f5e624359ce8dd604091adb940b2232520e60ba65fbf0  nls.patch
97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8  cpupower.initd
63cd12a4d8782198c71662e9205e346e064b65bae5e3e175b5bc43bdf7ec6ddf675b60349750afe3c37c8a925f9ae9a93530671821342581bd282a69e0773b8c  cpupower.confd"
